<!DOCTYPE html>
<html lang="zh-cN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScipt库</title>
    <script src="https://lib.baomitu.com/jquery/latest/jquery.js"></script>
    <link rel="stylesheet" href="../css/common.css">
</head>
<body>
    <h1>JQuery库</h1>
    <p class="msg"></p>
    <p><button>通过JQuery的ajax处理请求</button></p>
    <script>
      $(document).ready(function(){
        $("button").click(function(){
            $.ajax({
                url: "https://jsonplaceholder.typicode.com/posts/1",
                type: "get",
                dataType: "json",
                success: function(result){
                    $(".msg").html(result.title);
                }
            })
        })
      })
    </script>
</body>
</html>